#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import <QuartzCore/QuartzCore.h>
#import "PinNoteViewerDelegate.h"
#import "SFUConstants.h"
#import "GraphicsUtilities.h"

/**
 * A PinNoteViewer is an object representing the view for displaying
 * pin note information. It also provides the utility for editing, 
 * relocating, and deleting the given pin note.
 *
 * @author      James Lin
 * @version     1.3.7
 * @since       1.3.0
 */
@interface PinNoteViewer : UIViewController <UITextFieldDelegate, 
											 UITextViewDelegate, 
											 UIAlertViewDelegate> {
	id<PinNoteViewerDelegate> delegate;       // Delegate handling pin note viewer events
	AddressAnnotation*        currentPinNote; // Reference to pin note being edited
	UIScrollView*             inputView;      // Scrollable view for the details form
	UITextField*              titleField;     // Text field for the pin's title
	UITextView*               descView;       // Text view for the pin's notes
	UIToolbar*                toolbar;        // Toolbar for the pin note viewer
	BOOL                      isNewPinNote;   // Whether the pin note is new
	BOOL                      isEditOnly;     // Whether edit only mode is enabled
}

@property (nonatomic, retain) NSString* pinTitle;
@property (nonatomic, retain) NSString* pinDesc;

/**
 * Retrieve the shared instance of the pin note viewer.
 *
 * @return  the shared instance of PinNoteViewer
 */
+ (PinNoteViewer*)sharedPinNoteViewer;

/**
 * Display the pin note viewer.
 *
 * @param theDelegate  the delegate handling pin note viewer events
 * @param isNew        whether the display request is only to add a new pin note
 */
- (void)displayWithDelegate:(id<PinNoteViewerDelegate>)theDelegate 
			   isNewPinNote:(BOOL)isNew;

/**
 * Display the given pin note.
 *
 * @param pinNote      the pin note of which to display details
 * @param theDelegate  the delegate handling pin note viewer events
 */
- (void)displayPinNote:(id<MKAnnotation>)pinNote 
			  delegate:(id<PinNoteViewerDelegate>)theDelegate;

/**
 * Set the pin note viewer to editor mode.
 */
- (void)setEditable;

@end